(global.webpackJsonp = global.webpackJsonp || []).push([ [ "forum/release" ], {
    "12fa": function(t, e, i) {
        i.d(e, "b", function() {
            return o;
        }), i.d(e, "c", function() {
            return n;
        }), i.d(e, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, n = [];
    },
    "9b12": function(t, e, i) {
        i.r(e);
        var o = i("d537"), n = i.n(o);
        for (var r in o) "default" !== r && function(t) {
            i.d(e, t, function() {
                return o[t];
            });
        }(r);
        e.default = n.a;
    },
    ca0e: function(t, e, i) {
        var o = i("cf23");
        i.n(o).a;
    },
    cf23: function(t, e, i) {},
    d537: function(t, e, i) {
        (function(t) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var o = f(i("03b8")), n = f(i("acb5")), r = (i("7a6d"), i("f425")), a = i("7960"), u = (i("bc33"), 
            i("10aa")), c = i("8434"), s = (i("a71e"), i("db8f")), d = (f(i("801c")), i("26cb"));
            function f(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            function l(t) {
                return function(t) {
                    if (Array.isArray(t)) return h(t);
                }(t) || function(t) {
                    if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t);
                }(t) || function(t, e) {
                    if (t) {
                        if ("string" == typeof t) return h(t, e);
                        var i = Object.prototype.toString.call(t).slice(8, -1);
                        return "Object" === i && t.constructor && (i = t.constructor.name), "Map" === i || "Set" === i ? Array.from(t) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? h(t, e) : void 0;
                    }
                }(t) || function() {
                    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
                }();
            }
            function h(t, e) {
                (null == e || e > t.length) && (e = t.length);
                for (var i = 0, o = new Array(e); i < e; i++) o[i] = t[i];
                return o;
            }
            function p(t, e) {
                var i = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var o = Object.getOwnPropertySymbols(t);
                    e && (o = o.filter(function(e) {
                        return Object.getOwnPropertyDescriptor(t, e).enumerable;
                    })), i.push.apply(i, o);
                }
                return i;
            }
            function v(t, e, i) {
                return e in t ? Object.defineProperty(t, e, {
                    value: i,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[e] = i, t;
            }
            var m = t.getRecorderManager(), b = t.createInnerAudioContext();
            b.autoplay = !0;
            var _ = {
                components: {},
                computed: function(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        var i = null != arguments[e] ? arguments[e] : {};
                        e % 2 ? p(Object(i), !0).forEach(function(e) {
                            v(t, e, i[e]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : p(Object(i)).forEach(function(e) {
                            Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e));
                        });
                    }
                    return t;
                }({}, (0, d.mapGetters)([ "configs", "user", "mainColor", "iphoneXStyle", "priceColor", "isIphone" ])),
                data: function() {
                    return {
                        data: [ {
                            class: "icontupian"
                        }, {
                            class: "iconrecord-video"
                        }, {
                            class: "iconyuyin"
                        } ],
                        fileMedio: [],
                        files: [],
                        url: "",
                        isShow: !1,
                        bgColor: "",
                        isLive: !1,
                        info: "",
                        rec: "",
                        voicePath: "",
                        videoPath: "",
                        video_duration: "",
                        voice_duration: "",
                        blobs: "",
                        blob: "",
                        type: "",
                        isPlay: !1,
                        audio: "",
                        video_weight: "",
                        video_height: "",
                        audio_durition: 0,
                        subtxt: " 发布",
                        timeDurition: "",
                        animateColor: "",
                        fabu_content: "",
                        forum_set: {},
                        forum_typearr: [],
                        picker: [],
                        fabu_leibie: "发布类别",
                        fabu_index: -1,
                        voice_params: {},
                        type_id: -1,
                        type_arr: []
                    };
                },
                created: function() {
                    this.getforumtype(), this.getforumset();
                },
                onLoad: function(t) {
                    var e = this;
                    e.animateColor = (0, s.colorRgba)(e.mainColor, .5), m.onStop(function(t) {
                        e.fileMedio.map(function(t, i) {
                            "audio" == t.type && e.del("audio", i);
                        }), e.fileMedio.push({
                            type: "audio",
                            url: t.tempFilePath
                        }), e.voicePath = t.tempFilePath, e.voice_duration = Math.ceil(parseInt(t.duration) / 1e3) + '"', 
                        e.audio_durition = Math.ceil(parseInt(t.duration) / 1e3), e.voice_params = {
                            src: e.voicePath,
                            durition: e.audio_durition
                        };
                    }), b.onEnded(function(t) {
                        e.isPlay = !1;
                    });
                },
                onUnload: function() {},
                methods: {
                    PickerChange: function(t) {
                        this.fabu_leibie = this.picker[t.detail.value], this.fabu_index = t.detail.value, 
                        this.type_id = this.type_arr[this.fabu_index].id;
                    },
                    getforumtype: function() {
                        var t = this;
                        (0, r.forumType)({}).then(function(e) {
                            e.forEach(function(e) {
                                t.picker.push(e.title), t.type_arr.push(e);
                            });
                        });
                    },
                    getforumset: function() {
                        var t = this, e = this;
                        (0, r.forumSet)({}).then(function(i) {
                            t.forum_set = i, 2 != i.submit_condition || i.is_vip ? 3 != i.submit_condition || i.is_svip || (e.subtxt = "您不是超级会员,不可发布") : e.subtxt = "您不是会员,不可发布", 
                            1 == i.is_audio && e.recOpen();
                        });
                    },
                    submit: function() {
                        var e = this, i = this;
                        (1 == i.forum_set.submit_condition || 2 == i.forum_set.submit_condition && i.forum_set.is_vip || 3 == i.forum_set.submit_condition && i.forum_set.is_svip) && (0, 
                        a.h5JudgeLogin)(2).then(function(o) {
                            if (!o) {
                                if (0 == i.fabu_content.length) return e.$toast("请输入发布文字", "none"), !1;
                                if (-1 == i.fabu_index) return e.$toast("请选择发布类别", "none"), !1;
                                if ("发布中" == i.subtxt) return !1;
                                t.showLoading({
                                    title: "加载中"
                                }), e.files.length > 0 ? (0, u.uploadSlgnImage)(2, e.files).then(function(t) {
                                    e.files = t, i.uploadVideo();
                                }) : i.uploadVideo(), i.subtxt = "发布中";
                            }
                        });
                    },
                    uploadVideo: function() {
                        var t = this;
                        "" != t.voicePath && "" == t.videoPath ? t.upload("audio", t.voicePath).then(function(e) {
                            t.voicePath = e, t.putPunchcard();
                        }) : "" == t.voicePath && "" != t.videoPath ? t.upload("video", t.videoPath).then(function(e) {
                            t.videoPath = e, t.putPunchcard();
                        }) : "" != t.voicePath && "" != t.videoPath ? t.upload("video", t.videoPath).then(function(e) {
                            t.videoPath = e, t.upload("audio", t.voicePath).then(function(e) {
                                t.voicePath = e, t.putPunchcard();
                            });
                        }) : t.putPunchcard();
                    },
                    putPunchcard: function() {
                        var e = this;
                        t.hideLoading();
                        var i = {
                            type_id: this.type_id,
                            content: this.fabu_content,
                            video: this.videoPath,
                            audio: this.voicePath,
                            imglist: this.files.join(","),
                            video_weight: this.video_weight,
                            video_height: this.video_height,
                            audio_durition: this.audio_durition
                        };
                        (0, r.forumSubmit)(i).then(function(i) {
                            1 == e.forum_set.submit_verify && t.showToast({
                                icon: "none",
                                title: "发布成功,等待平台审核",
                                duration: 2e3
                            }), 0 == e.forum_set.submit_verify && t.showToast({
                                icon: "none",
                                title: "发布成功",
                                duration: 2e3
                            }), e.subtxt = "确认提交", setTimeout(function() {
                                (0, c.route)({
                                    url: "/forum/index",
                                    type: 3
                                });
                            }, 2e3);
                        });
                    },
                    del: function(t, e) {
                        "video" == t ? this.videoPath = "" : this.voicePath = "", this.fileMedio.splice(e, 1);
                    },
                    delImg: function(t) {
                        this.files.splice(t, 1);
                    },
                    delVoice: function() {
                        this.voice_params = {}, this.fileMedio = [];
                    },
                    putlive: function() {
                        this.isLive = !this.isLive, this.isLive ? this.startRecord() : this.endRecord();
                    },
                    open: function(t) {
                        switch (t) {
                          case 2:
                            this.isShow = !0, this.stopVoice();
                            break;

                          case 1:
                            this.chooseVideo();
                            break;

                          case 0:
                            this.chooseImg();
                        }
                    },
                    close: function() {
                        this.isShow = !1;
                    },
                    discard: function() {},
                    recOpen: function() {},
                    startRecord: function() {
                        m.start();
                    },
                    endRecord: function() {
                        m.stop(), this.close();
                    },
                    stopVoice: function() {
                        b.stop();
                    },
                    playVoice: function() {
                        var t = this;
                        if (t.isPlay) return t.isPlay = !t.isPlay, t.stopVoice(), !1;
                        t.isPlay = !t.isPlay, b.src = t.voicePath, b.play();
                    },
                    chooseImg: function() {
                        var e = this;
                        if (this.files.length >= 9) return t.showToast({
                            icon: "none",
                            title: "图片上传最多为9张",
                            duration: 1e3
                        }), !1;
                        var i = 9 - this.files.length;
                        t.chooseImage({
                            count: i,
                            sizeType: [ "original", "compressed" ],
                            sourceType: [ "album" ],
                            success: function(t) {
                                e.files = [].concat(l(e.files), l(t.tempFilePaths));
                            }
                        });
                    },
                    chooseVideo: function() {
                        var e = this;
                        t.chooseVideo({
                            sourceType: [ "camera", "album" ],
                            success: function(t) {
                                e.fileMedio.map(function(t, i) {
                                    "video" == t.type && e.del("video", i);
                                }), e.fileMedio.push({
                                    type: "video",
                                    url: t.tempFilePath
                                }), e.video_duration = t.duration.toFixed(2), e.videoPath = t.tempFilePath, e.video_weight = t.width, 
                                e.video_height = t.height;
                            }
                        });
                    },
                    upload: function(e, i) {
                        var r = {};
                        return "audio" == e && (r = {
                            i: o.default.uniacid,
                            file_type: "audio"
                        }), new Promise(function(e, o) {
                            t.uploadFile({
                                url: n.default.upImg,
                                filePath: i,
                                header: {
                                    "Content-Type": "multipart/form-data"
                                },
                                name: "file",
                                formData: r,
                                success: function(t) {
                                    e(JSON.parse(t.data).data);
                                },
                                fail: function(t) {
                                    o(), console.log(t);
                                }
                            });
                        });
                    }
                }
            };
            e.default = _;
        }).call(this, i("543d").default);
    },
    d931: function(t, e, i) {
        i.r(e);
        var o = i("12fa"), n = i("9b12");
        for (var r in n) "default" !== r && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(r);
        i("ca0e");
        var a = i("f0c5"), u = Object(a.a)(n.default, o.b, o.c, !1, null, "ab0defa6", null, !1, o.a, void 0);
        e.default = u.exports;
    },
    d939: function(t, e, i) {
        (function(t) {
            i("1067"), o(i("66fd"));
            var e = o(i("d931"));
            function o(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = i, t(e.default);
        }).call(this, i("543d").createPage);
    }
}, [ [ "d939", "common/runtime", "common/vendor" ] ] ]);